//
//  NMyInfoHeadView.m
//  News
//
//  Created by zhangtao on 2018/10/15.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "NMyInfoHeadView.h"

@implementation NMyInfoHeadView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = RGB(249, 249, 249, 1);
        _headImgV = [[UIImageView alloc]initWithFrame:CGRectMake(frame.size.width/2-frame.size.height/4, frame.size.height/4-10,frame.size.height/2, frame.size.height/2)];
        _headImgV.image = [UIImage imageNamed:@"bigImage"];
        _headImgV.layer.cornerRadius = frame.size.height/4;
        _headImgV.layer.masksToBounds = YES;
        [self addSubview:_headImgV];
        
        UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(frame.size.width/2-100, CGRectGetMaxY(_headImgV.frame)+5, 200, 20)];
        [btn setTitle:@"点击上传头像" forState:UIControlStateNormal];
        [btn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
        [btn addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
        btn.titleLabel.font = SUPER_MIN_FONT;
        [self addSubview:btn];
    }
    return self;
}

-(void)click
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(upLoadHeardImageViewBtnClickWithSelf:)]) {
        [self.delegate upLoadHeardImageViewBtnClickWithSelf:self];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
